﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using TCS.Model;
using TCS.BLL;

namespace TCS.Web.MembersHome
{
    public partial class ModifyPwd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Session["BangShangMember"] != null)
            {
                TCS.Model.MemberInfo member = (TCS.Model.MemberInfo)Session["BangShangMember"];
                if (this.txtPassword.Text == member.MI_password)
                {
                    new TCS.BLL.MemberInfo().UpdatePassword(member.Id,this.txtNewPassword.Text.Trim().ToString());
                    LTP.Common.MessageBox.Show(this.Page, "密码修改成功！");
                }
                else
                {
                    LTP.Common.MessageBox.Show(this.Page, "您输入的原密码不正确！");
                }
            }
            else 
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('连接超时，请重新登录！')</script>;localtion.href='login.aspx'");
            }  
        }
    }
}
